﻿@using QDT.Common
@using QDT.Core
@using QDT.Core.Projects
@model QDT.Common.IPagedList<QDT.Core.Projects.ParentProject>

@section HeadSection {

    @Html.IncludeCSS("~/Content/Css/jquery-calendar.css")
    @Html.IncludeScript("~/Content/JS/jquery-calendar.js")

}

<div class="main_title">
    贷款列表</div>
<div class="blank5">
</div>
<div class="button_row">
    @Html.ActionLink("新增", "AddLoan", new {}, new {@class = "button"})
    @*    <a class="button" href="javascript: del()">删除</a>*@
</div>
<div class="blank5">
</div>
<div class="search_row">
    <form name="search" action="@Url.Action("Index")" method="get">	
        编号：<input type="text" class="textbox" name="projectId" value="@Request.Params["id"]" size="8"/>
        贷款名称：<input type="text" class="textbox" name="name" value="@Request.Params["name"]"/>
        分类:
        <select name="typeID">
            <option value="-1">所有分类</option>
            @foreach (ProjectType type in ViewData["ProjectTypes"] as IList<ProjectType>)
            {
                <option value="@type.ID">@type.Name</option>
            }
        </select>
        用户名：<input type="text" class="textbox" name="username" value="@Request.Params["username"]"/>
        期限：<input type="text" class="textbox" name="repayTime" value="@Request.Params["repayTime"]" size="8"/>
        <input type="submit" class="button" value="搜索"/>
    </form>
</div>
<div class="grid_box">
    <div class="grid_top">
    </div>
    @Html.Grid(Model).Columns(column =>
        {
            column.CheckBox(x => x.ID);
            column.For(x => x.ID).Named("编号").HeaderAttributes(style => "width:50px;");
            column.For(x => Html.ActionLink(x.Name, "EditLoan", new {id = x.ID})).Named("贷款名称").SortColumnName("Name");
            column.For(x => x.CreateTime).Named("创建时间").HeaderAttributes(style => "width:180px;").SortColumnName("CreateTime");
            column.For(x => Html.F().GetPrjectTypeName(x.TypeId)).Named("贷款类型").SortColumnName("TypeID");
            column.For(x => x.RepayTime + "月").Named("期限").SortColumnName("RepayTime");
            column.For(x => Html.F().GetUserName(x.UserId)).Named("借款人").SortColumnName("UserID");
            column.For(x => x.BorrowAmount.ToMoney()).Named("借款资金").SortColumnName("BorrowAmount");
            column.For(x => x.IsEffect ? "有效" : "无效").Named("状态").SortColumnName("IsEffect");
            column.Buttons(btns => btns.Add(x => Html.ActionLink("编辑", "EditLoan", new { id = x.ID }))
                                       .Add(x => Html.ActionLink("相关图片", "Images", new { id = x.ID }))
                                       .Add(x => Html.ActionLink("添加标", "AddProject", "Project", new { id = x.ID }, ""))
                );
        }).Complex(ViewData)
    <div class="grid_foot">
    </div>
</div>
<div class="blank5">
</div>
@Html.Pager(Model)